<link rel=stylesheet type=text/css href="<?=$navheadurl?>css/jumpbox.css" />
<script src="<?=$navheadurl?>template/<?=MOBAN?>/js/function.js"></script>
<script src="<?=$navheadurl?>js/jumpbox.js"></script>
<script src="<?=$navheadurl?>data/noWordArr.js"></script>
<script src="<?=$navheadurl?>template/<?=MOBAN?>/js/taokey.js"></script>
<script>
function reg_url(url){
	var name=$('#s-txt').attr('name');
    if(url.indexOf('http://')<0 && (name=='q')){ //不是网址
	    var word=inArray(url,noWordArr);
	    if(word!=''){
		    alert('无此商品，请更换其他商品查询！');
		    return 2;
		}
		else{
		    return 1;
		}
	    
	}
	else{  //是网址
	    return 0;
	}
}
$(function(){
    $('.searchbox .box').jumpBox({  
		LightBox:'show',
		jsCode:'$content.html($("#searchtip").html());',
		reg:'reg_url($("#s-txt").val())',
		height:250,
		width:555,
		bind:'submit',
		a:1,
		background:'url(images/xiexian.gif) #FFFFFF'
    });
})
</script>
<div class="navtop">
<div class="logo"><A href="<?=$navheadurl?>index<?=$end?>" <?php if($tag=='index'){echo "class=current";}?> title="网上购物，从这里开始" ><img alt="<?=WEBNICK?>" src="<?=$navheadurl?>template/<?=MOBAN?>/images/logo.gif" /></A></div>

<?php if($tag=='tg'){?>
<div style="float:left; margin-left:15px;">
<div class="tuangouflsy_logo_span2">
       <span class="tuangouflsy_logo_span3" style="margin-bottom:3px;position:relative;"><?=$cur_city?></span>
       <span class="tuangouflsy_logo_span3" style="position:relative; z-index:999;"><input class="submit1" type="button" name="button" id="button" value="" onclick="open_city(this)" />

<div class="tuangouflsy_pf" style="display:none;" onclick="clickDiv(this)" id="div"><span class="tuangouflsy_pf_guanbi"><a href="javascript:void(0)" onclick="close_city()">关闭</a></span>
   <div class="tuangouflsy_pf_zhongdian">
     <ul>
       <li>
          <span class="tuangouflsy_pf_span1">核心城市</span>
          <span class="tuangouflsy_pf_span2">
          <?php foreach($city_sort_arr as $k=>$v){?>
          	<span class="tuangouflsy_pf_span3"><a href="tg<?=$url_head_city_id?><?=$k?><?=$url_end?>"><?=$v?></a></span>
          <?php }?>
          </span>
       </li>
        <li style="margin-bottom:10px;"><span class="textcolor1" >请按照拼音首字母来选择城市</span></li>
     </ul>
      <div style="clear:both"></div>
   </div>
   <div class="tuangouflsy_pf_xuanqu">
      <div class="tuangouflsy_pf_yinwen">
      <a href="javascript:void(0)" onclick="changeCity('a')" id="city_a_a" class="sekuai">A</a>
      <a href="javascript:void(0)" onclick="changeCity('b')" id="city_a_b" class="sekuai">B</a>
      <a href="javascript:void(0)" onclick="changeCity('c')" id="city_a_c" class="sekuai">C</a>
      <a href="javascript:void(0)" onclick="changeCity('d')" id="city_a_d" class="sekuai">D</a>
      <a href="javascript:void(0)" onclick="changeCity('e')" id="city_a_e" class="sekuai">E</a>
      <a href="javascript:void(0)" onclick="changeCity('f')" id="city_a_f" class="sekuai">F</a>
      <a href="javascript:void(0)" onclick="changeCity('g')" id="city_a_g" class="sekuai">G</a>
      <a href="javascript:void(0)" onclick="changeCity('h')" id="city_a_h" class="sekuai">H</a>
      <a href="javascript:void(0)" onclick="changeCity('j')" id="city_a_j" class="sekuai">J</a>
      <a href="javascript:void(0)" onclick="changeCity('k')" id="city_a_k" class="sekuai">K</a>
      <a href="javascript:void(0)" onclick="changeCity('l')" id="city_a_l" class="sekuai">L</a>
      <a href="javascript:void(0)" onclick="changeCity('m')" id="city_a_m" class="sekuai">M</a>
      <a href="javascript:void(0)" onclick="changeCity('n')" id="city_a_n" class="sekuai">N</a>
      <a href="javascript:void(0)" onclick="changeCity('p')" id="city_a_p" class="sekuai">P</a>
      <a href="javascript:void(0)" onclick="changeCity('q')" id="city_a_q" class="sekuai">Q</a>
      <a href="javascript:void(0)" onclick="changeCity('r')" id="city_a_r" class="sekuai">R</a>
      <a href="javascript:void(0)" onclick="changeCity('s')" id="city_a_s" class="sekuai">S</a>
      <a href="javascript:void(0)" onclick="changeCity('t')" id="city_a_t" class="sekuai">T</a>
      <a href="javascript:void(0)" onclick="changeCity('w')" id="city_a_w" class="sekuai">W</a>
      <a href="javascript:void(0)" onclick="changeCity('x')" id="city_a_x" class="sekuai">X</a>
      <a href="javascript:void(0)" onclick="changeCity('y')" id="city_a_y" class="sekuai">Y</a>
      <a href="javascript:void(0)" onclick="changeCity('z')" id="city_a_z" class="sekuai">Z</a>      
      </div>
      <?php foreach($city_word_arr as $k=>$v){?>
      <div id="city_span_<?=$k?>" class="tuangouflsy_pf_chengshi" >
          <?php foreach($v as $key=>$val){?>
      		<a href="tg<?=$url_head_city_id?><?=$val?><?=$url_end?>" ><?=$city_sort_arr[$val]?></a>
          <?php }?>
      </div>
      <?php }?>
            <div style="clear:both"></div>
   </div>
</div>
       </span>
       <div style="clear:both"></div>
    </div>
</div>
<?php }?>
<div class="searchbox">
<div style="width:525px; text-align:left">
<div class="s-nav">
  <a class="y" id="shangpin" value="输入您想要的宝贝" s="<?=$navheadurl?>view.php" name="q">宝贝</a>
  <a class="n" id="zhanggui" value="输入您想找的掌柜" s="<?=$navheadurl?>shoplist.php" name="keyword">掌柜</a>
  <a class="n" id="shangcheng" value="输入您想要的商城" s="<?=$navheadurl?>malllist.php" name="mall">商城</a>
  <a class="n" id="fenxiang" value="输入您想找的分享" s="<?=$navheadurl?>baobeilist.php" name="key">分享</a>
  <?php if(TGOPEN==1){?>
  <a class="n" id="tuan" value="输入您想要搜的团购" s="<?=$navheadurl?>tg.php" name="keyword">团购</a>  
  <?php }?>
</div>
<div class="clear"></div>
<form class="box" name="formname" target="_blank" method="get" action="<?=$navheadurl?>view.php" style="float:left; ">
  <span class="box-middle"><input name="q" onfocus="this.value='';" type="text" id="s-txt" class="s-txt" value="输入您想要的淘宝商品网址" /><input type="hidden" name="search" value="1" /><input type="submit" class="sbutton" value="" /></span>
  <span class="box-right"></span>
</form>
</div>
</div>
</div>
<div id="tab" >
<?php
if(mysql_ping($cfg_link)==''){
	mysql_close($cfg_link);
    $cfg_link = mysql_connect($dbserver, $dbuser, $dbpass);
	if(mysql_error()!=''){echo mysql_error();echo 'link error';exit;}
	mysql_select_db($dbname);
    mysql_query("set names utf8");
}
$sql="select * from ".$BIAOTOU."nav where hide=0 order by sort desc limit 9";
$query=mysql_query($sql);
while($row=mysql_fetch_array($query)){
	if($row['tag']==$tag){$class="class='nowtab'";}
	else $class="class='linktab'";
	if($row['target']==0) $target="target='_self'";
	elseif($row['target']==1) $target="target='_blank'";
	$link="<a href='".$row['link']."' ".$target."><span ".$class.">".$row['name']."</span></a>";
    $nav[]=$link;
}

echo $nav_link=implode('<img alt="导航" class="topmargin" '.$tag.' src="'.$navheadurl.'template/'.MOBAN.'/images/sline.png" />',$nav);
?>              
</div>